<template>
  <div>
      <el-table :data="gridData" border max-height=500 >
      <el-table-column  label="更新人员"  align='center'>
        <template slot-scope="scope">
          {{scope.row.username}}
        </template>
      </el-table-column>
      <el-table-column  label="更新时间" align='center'>
        <template slot-scope="scope">
          {{scope.row.time}}
        </template>
      </el-table-column>
      <el-table-column  label="操作" align='center'>
        <template slot-scope="scope">
          {{scope.row.doc}}
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
        style="margin-top:10px"
        background
        @current-change="handleCurrentChange"
        :current-page="current"
        :page-size="baseSize"
        layout="total, prev, pager, next, jumper"
        :total="total"
        >
      </el-pagination>
  </div>
</template>

<script>
import { getHeaderName } from '@/app.config'
export default {
    props:{
        projectName:{
            type:String,
        }
    },
    mounted(){
        this.getData()
    },
    data(){
        return{
            gridData:[],
            total:0,
            baseSize:10,
            current:1,
        }
    },
    methods:{
        handleCurrentChange(val) {
            this.current = val;
            this.getData()
        },
        getData(){
            this.$axios({
                url: process.env.VUE_APP_SOURSE_MANAGE_HOST + '/api/v1/project/project_change_site_power',
                method: "get",
                headers: getHeaderName(),
                params: {
                    "page" :this.current ,
                    "project_name" : this.projectName
                }
                }).then((res => {
                    console.log(res)
                    this.gridData = res.data.data.data
                    this.total = res.data.data.totalCount
                }))
            }
    }
}
</script>

<style>

</style>